import Vue from 'vue'
import Vuex from 'vuex'
import {
  getItem
} from "../utils/storage"

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user: getItem('user') || {}
  },
  mutations: {
    UPDATE_USER(state, val) {
      state.user = Object.assign(state.user, val)
    },
    DELETE_USER(state) {
      state.user = {}
    }
  },
  actions: {},
  modules: {}
})